<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich">

<rich:tab id="customerTabDiscountId" header="#{msg.label_tab_discount}">

	<rich:dataTable id="customerDiscountTableId"
		value="#{createCustomerBean.customer.customerDiscountList}"
		var="disccountVo" iterationStatusVar="sta"
		rendered="#{createCustomerBean.customer.customerDiscountList.size()>0}">
		<f:facet name="header">
			<rich:columnGroup>
				<rich:column>
					<h:outputText value=""></h:outputText>
				</rich:column>
				<rich:column>
					<h:outputText value="#{msg.label_discount_type}"></h:outputText>
				</rich:column>
				<rich:column>
					<h:outputText value="#{msg.label_discount_date}"></h:outputText>
				</rich:column>
				<rich:column>
					<h:outputText value="#{msg.label_discount_default_option}"></h:outputText>
				</rich:column>
				<rich:column>
					<h:outputText value=""></h:outputText>
				</rich:column>
			</rich:columnGroup>
		</f:facet>

		<rich:columnGroup>
			<rich:column>
				<h:outputText value="#{sta.count}"></h:outputText>
			</rich:column>
			<rich:column>
				<h:selectOneMenu value="#{disccountVo.discCde}">
					<f:selectItem itemLabel="" itemValue=""></f:selectItem>
					<f:selectItems value="#{createCustomerBean.discountItems}"></f:selectItems>
				</h:selectOneMenu>
			</rich:column>
			<rich:column>
				<rich:calendar value="#{disccountVo.expiryDte}"
					datePattern="yyyy-MM-dd"></rich:calendar>
			</rich:column>
			<rich:column>
				<h:selectOneMenu value="#{disccountVo.defltInd}">
					<f:selectItem itemLabel="" itemValue=""></f:selectItem>
					<f:selectItem itemLabel="#{msg.label_yes}" itemValue="Y"></f:selectItem>
					<f:selectItem itemLabel="#{msg.label_no}" itemValue="N"></f:selectItem>
				</h:selectOneMenu>
			</rich:column>
			<rich:column>
				<a4j:commandButton
					actionListener="#{createCustomerBean.deleteDiscount}"
					render="customerTabDiscountId" value="#{msg.button_delete}">
					<f:param name="attributeIndex" value="#{sta.index}"></f:param>
				</a4j:commandButton>
			</rich:column>
		</rich:columnGroup>
	</rich:dataTable>

	<a4j:commandLink actionListener="#{createCustomerBean.addDiscount}"
		render="customerTabDiscountId" value="#{msg.label_discount_add}">
	</a4j:commandLink>


</rich:tab>

</html>